-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update to Polkadot v1.1.0 #536
Conversation
…pe to avoid Static wrapper
d2d452a
to
d2662c6
Compare
@pendulum-chain/devs keep in mind that for some reason the tests fail on the CI environment but locally they seem to be okay, so that needs to be solved first. If anyone has any idea about that |
8f6e331
to
db6e39d
Compare
* add extra cargo.toml specially for CI testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to change the version from 1.0.9 back to 1.0.10 again. Also, I think at least one merge commit has to be faulty. At least I found a lot of changes that look like regressions and should be reverted.
Why exactly do we need the new all-features
feature?
.cargo/config.toml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@b-yap we just recently added this file so I think we want to keep it, right?
clients/README.md
Outdated
|
||
> **Note**: [Rustflags are required](https://github.com/tokio-rs/console?tab=readme-ov-file#instrumenting-your-program) to make `tokio-console` work. | ||
It has been defined directly in [.cargo/config.toml](../.cargo/config.toml). | ||
|
||
The vault is `tokio-console` ready, with the feature **_`allow-debugger`_**. _Remember to [set the rustflags](https://github.com/tokio-rs/console?tab=readme-ov-file#instrumenting-your-program)!_ | ||
``` | ||
cargo run --bin vault --features allow-debugger | ||
RUSTFLAGS="--cfg tokio_unstable" cargo run --bin vault --features allow-debugger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also looks like a regression to me.
clients/runner/Cargo.toml
Outdated
@@ -1,6 +1,6 @@ | |||
[package] | |||
name = "runner" | |||
version = "1.0.10" | |||
version = "1.0.9" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't turn back the version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure! Must be as you say a faulty merge commit to main, because it is up-to-date now.
@@ -111,13 +139,12 @@ pub struct WrapperKeepOpaque<T> { | |||
pub struct SpacewalkRuntime; | |||
|
|||
impl Config for SpacewalkRuntime { | |||
type Index = Index; | |||
type BlockNumber = BlockNumber; | |||
type AssetId = (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the AssetId
used for? Is it okay to leave it empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a new field from the subxt
Config
trait, but as the comment of this type says, I believe it is not relevant for our standalone testchain.
clients/vault/src/system.rs
Outdated
async fn try_shutdown_agent(&mut self) { | ||
let opt_agent = self.agent.clone(); | ||
self.agent = None; | ||
|
||
if let Some(arc_agent) = opt_agent { | ||
tracing::info!("try_shutdown_agent(): shutting down agent"); | ||
arc_agent.shutdown().await; | ||
} else { | ||
tracing::debug!("try_shutdown_agent(): no agent found"); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
clients/wallet/src/mock.rs
Outdated
_public_key(dest_secret) | ||
} | ||
|
||
pub fn default_source() -> PublicKey { | ||
let source_secret = get_source_secret_key_from_env(IS_PUBLIC_NETWORK); | ||
_public_key(source_secret) | ||
} | ||
|
||
fn _public_key(secret: String) -> PublicKey { | ||
let dest_secret_key = SecretKey::from_encoding(secret).expect("should work"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not need a default source anymore?
clients/wallet/src/operations.rs
Outdated
const DEFAULT_SOURCE_PUBLIC_KEY: &str = | ||
"GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"; | ||
const DEFAULT_DEST_PUBLIC_KEY: &str = | ||
"GBWYDOKJT5BEYJCCBJRHL54AMLRWDALR2NLEY7CKMPSOUKWVJTCFQFYI"; | ||
|
||
fn default_testing_stellar_pubkeys() -> (PublicKey, PublicKey) { | ||
(default_source(), default_destination()) | ||
( | ||
public_key_from_encoding(DEFAULT_SOURCE_PUBLIC_KEY), | ||
public_key_from_encoding(DEFAULT_DEST_PUBLIC_KEY), | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also regression?
pallets/issue/src/benchmarking.rs
Outdated
@@ -28,17 +29,12 @@ fn deposit_tokens<T: crate::Config>( | |||
account_id: &T::AccountId, | |||
amount: BalanceOf<T>, | |||
) { | |||
assert_ok!(<orml_currencies::Pallet<T>>::deposit(currency_id, account_id, amount)); | |||
assert_ok!(<orml_tokens::Pallet<T>>::deposit(currency_id, account_id, amount)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regression. Using orml_currencies
here is important.
@@ -24,6 +25,10 @@ use spacewalk_runtime_testnet::RuntimeApi as TestnetRuntimeApi; | |||
// Native executor instance. | |||
pub struct TestnetExecutor; | |||
|
|||
/// The minimum period of blocks on which justifications will be | |||
/// imported and generated. | |||
const GRANDPA_JUSTIFICATION_PERIOD: u32 = 512; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we tried fiddling with this parameter? I found a test in the polkadot-sdk where it's defined to just 32. I honestly don't really understand the implications of this parameter, just something that came to my mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean for the test issue? No, this is the standard value used in one of the templates of the polkadot-sdk
. Yet, for our instant seal this shouldn't matter since we are not using the consensus at all.
EDIT: please ignore this comment as we will no longer need this feature, we can use it as in this commit. @ebma the Since when running the test like we generally do with the |
@pendulum-chain/devs I wanted to comment on the test issue we were facing a while ago, and summarize how we are dealing with it at the moment. As a summary of the attempts and experiments using extra logs in this PR we identify that the issue happens when sealing a block on linux operating systems (especially in low spec CI runners), the creation of a new block and the application of the inherents consumes all the time specified by the whole process of applying extrinsics, therefore ending up hitting the deadline condition before applying a single extrinsic. Please refer to the following example CI run, logs were set before and after each of these operations. We can see that we spend already 4 seconds on each by the timestamps. Therefore, in order to workaround this issue, we modify this constant to a larger number (in this case, 60 seconds) such that the extrinsics have enough time to be applied. We can then use this forked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last CI job failed due to a shaky test so let's assume that it works generally. Thanks for all your efforts with this issue @gianfra-t. Let's merge this now.
Issue #534.
Changes in Pallets
Header
andBlockNumber
inframe_system
.Index
withNonce
.Default
trait of theGenesisConfig
struct with a manual definition, to fix an error on the macroconstruct_runtime
when using the previous#[derive(default)]
macro.Default
trait has to be defined for allGenesisConfig
structs, not just whenstd
feature is enabled.construct_runtime
can be used without defining the components of the module. This is less error prone since hard to debug errors may appear when missing a component. (If we are okay with this change, I can later modify the rest).GenesisBuild
.pallet_aura
config.AllowMultipleBlocksPerSlot
should befalse
if used in normal scenario (not augmented with a custom pallet).pallet_grandpa
MaxNominators
. The value is set at1000
, previously this was set by default as200
. This value is used for weight calculations.Node changes
Changes made using as base the
substrate-node-template
from the developer hub, at a commit using version1.0.0.
Most relevant change is how the off-chain worker is spawned. Here is the change for the template between the relevant version.
Other code changes
Modification of parameters of
SubxtClientConfig
.rpc_max_response_size
is defined as the default value, in megabytes.rpc_max_request_size
is deprecated and has no effect.Subxt update
subxt
had to be updated from0.25.0
to(we ended up using0.28.0
0.33.0
) due to a conflict withschnorkell
package. This is the lowest version that solves that issue. Nevertheless, this new version introduced some breaking changes that have to be handled:substrate-compat
has to be used now for many of the functions and exports regarding substrate compatibility.ModuleError
are now accessed differently, which impacts this match.EncodeAsType
andDecodeAsType
now should be wrapped in aStatic
struct, which is the case withCurrencyId
and all the corresponding uses of it on the code.To avoid wrapping as static the type
AccountId
, we use theAccountId
type fromsubxt
.Keyring
to subxt'sAccountId
, which is done now as in the package tests. Here is an example on our code.AccountId
fromsubxt
does not have some of the traits required, we need to transform to thesp
version of it before using that functionality, a good example is here where we use needsp_runtime
version for hashing.